using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace GameUI {
	public class WeaponButtonImage:ButtonImage {
		protected override void Start() {
			base.Start();
			menu=GetComponentInParent<IWeaponSelection>();
			image=GetComponent<Image>();
			image.sprite=Player.instance.GetWeapon(weaponIndex).defaultWeapon.sprite;
		}
		protected override void Update() {
			base.Update();
			if(menu.GetSelectedWeapon()==weaponIndex) image.color=Color.white;
			else image.color=Color.gray;
		}

		IWeaponSelection menu;
		Image image;
		[SerializeField]
		int weaponIndex;
	}
}